/**
 author: chengzheng
 date: 2017/12/27
 email: 13120207061@163.com
 */

const Producer = require("../work/producer");
const Task = require('../work/task');


let myProducer = new Producer({
    channel: 'demo',
    dbConf: {
        redis: {
            host: 'localhost',
            port: 6379
        }
    }
});



var tasks = [];
tasks.push(
    new Task({
        spiderType: 'plain',
        url: 'https://juejin.im/',
        headers: {
            "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
            // "Referer": "http://cat.sankuai.com/cat/r/e?ip=All&domain=com.sankuai.travel.spider.checkinseat",
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36"
            // "Cookie": ""
        }
        // proxy: "http://localhost:8888"
    })
);
//...tasks.push({});


myProducer.sendTaskToQueue(tasks).then(() => {
    console.log('send done....');
});